/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package introse;

/**
 *
 * @author Owel
 */
 import java.sql.*;
import javax.swing.JOptionPane;
public class Connect 
{
        public static void main(String[] args) 
        {
                
        }
        public Connection dbConnect()
        {
                try
                {
                        Class.forName("com.mysql.jdbc.Driver").newInstance();
                        Connection conn = DriverManager.getConnection(
                          "jdbc:mysql://localhost:3306/mp", "root", "pascual");
      
                        System.out.println("connected");
                        return conn;
                        
                }
                catch (Exception e)
                {
                        JOptionPane.showMessageDialog(null,"Cannot connect to mysql");
                        return null;
                }
        }
}

